Add canonicalization modifier: assume not canonical.#1809
Closed
evanlinjin wants to merge 5 commits intobitcoindevkit:masterfrom
Closed
Add canonicalization modifier: assume not canonical.#1809evanlinjin wants to merge 5 commits intobitcoindevkit:masterfrom
evanlinjin wants to merge 5 commits intobitcoindevkit:masterfrom
Conversation
Introduce `CanonicalizationMods` which is passed in to `CanonicalIter::new`. `CanonicalizationMods::assume_canonical` is the only field right now. This contains a list of txids that we assume to be canonical, superceding any other canonicalization rules.
Also change `TxTemplate` API to allow for testing with `assume_canonical`.
This is useful for crafting RBF transactions where you do not want to pick inputs from txs you are replacing or descendants of txs you are replacing.
Collaborator
|
As in #1808 it would be nice to have a draft PR that uses this to clean up RBF in wallet to see if we've got everything we need here. |
Member
|
Took this out of the |
8 tasks
5 tasks
Member
Author
|
I've realized there's a flaw with the Consider a case where transaction Since this feature is intended to support RBF behavior, this logic doesn't actually help us. The correct assume_not_spent: HashSet<OutPoint>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is useful for creating RBF transactions where you do not want to spend from txs you are replacing or descendants of txs you are replacing.
I noticed that some users think it is useful to implicitly cancel a tx. This can also be used for that. cc. #1799, #1764.
Notes to the reviewers
This PR is based on #1808. Please review and merge that first.
Changelog notice
WIP
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: